import request from '@/utils/request'

// 退料单列表
export function materialReturnList(data) {
    return request({
        url: '/system/materialReturn/list',
        method: 'get',
        params: data
    })
}

// 获取退料单详细信息
export function materialReturnDetail(id) {
    return request({
        url: '/system/materialReturn/getInfo?id=' + id,
        method: 'get'
    })
}

// 新建退料单
export function materialReturnAdd(data) {
    return request({
        url: '/system/materialReturn/add',
        method: 'post',
        data: data
    })
}

// 编辑退料单
export function materialReturnEdit(data) {
    return request({
        url: '/system/materialReturn/edit',
        method: 'post',
        data: data
    })
}

// 删除领料单
export function materialReturnDelete(id) {
    return request({
        url: '/system/materialReturn/remove?id=' + id,
        method: 'get'
    })
}

// 获取领料单列表
export function materialRequisitionList(data) {
    return request({
        url: '/system/materialReturn/getRequisitionList?returnParams=' + data,
        method: 'get'
    })
}

// 获取领料单详情
export function materialRequisitionDetail(id) {
    return request({
        url: '/system/materialReturn/getRequisitionOne?id=' + id,
        method: 'get'
    })
}

// 新建单条数据
export function materialReturnAddSingle(data) {
    return request({
        url: '/system/materialReturnDetail/add',
        method: 'post',
        data: data
    })
}

// 编辑单条数据
export function materialReturnEditSingle(data) {
    return request({
        url: '/system/materialReturnDetail/edit',
        method: 'post',
        data: data
    })
}

// 单条数据删除
export function materialReturnDel(id) {
    return request({
        url: '/system/materialReturnDetail/remove?id=' + id,
        method: 'get'
    })
}

// 扫码领料
export function materialReturnScanCode(data) {
    return request({
        url: '/system/materialReturn/scanCode',
        method: 'post',
        data: data
    })
}

// 删除扫码
export function materialReturnDelScanCode(data) {
    return request({
        url: '/system/materialReturn/deleteCode',
        method: 'post',
        data: data
    })
}

// 多仓位列表
export function morePositionList(id) {
    return request({
        url: '/system/materialReturn/getPosition?id=' + id,
        method: 'get',
    })
}

// 多仓位新建数据
export function morePositionAdd(data) {
    return request({
        url: '/system/materialReturn/addPosition',
        method: 'post',
        data: data
    })
}

// 多仓位编辑数据
export function morePositionEdit(data) {
    return request({
        url: '/system/materialReturn/editPosition',
        method: 'post',
        data: data
    })
}

// 多仓位仓位编辑
export function morePositionUpdate(data) {
    return request({
        url: '/system/materialReturn/updatePosition',
        method: 'post',
        data: data
    })
}

// 多仓位单个新建
export function morePositionAddSingle(data) {
    return request({
        url: '/system/productMultiPosition/add',
        method: 'post',
        data: data
    })
}

// 多仓位单个删除
export function morePositionDelSingle(id) {
    return request({
        url: '/system/materialReturn/removePosition?id=' + id,
        method: 'post'
    })
}

// 提交
export function materialReturnSubmit(data) {
    return request({
        url: '/system/materialReturn/submit',
        method: 'post',
        data: data
    })
}

// 审核
export function materialReturnCheckReturn(data) {
    return request({
        url: '/system/materialReturn/checkReturn',
        method: 'post',
        data: data
    })
}

// 确认退料
export function confirmReturn(data) {
    return request({
        url: '/system/materialReturn/confirmReturn',
        method: 'post',
        data: data
    })
}